<h1>修改用户信息</h1>

<% form_for(@user) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label "用户代码" %><br />
    <%= f.text_field :user_code %>
  </p>
  <p>
    <%= f.label "用户名称" %><br />
    <%= f.text_field :user_name %>
  </p>
  <p>
    <%= f.label "所在科室" %><br />
    <%= f.select :user_dep_id, Dep.find(:all).collect{|t|[t.dep_name,t.id]} ,:include_blank => false %>
  </p>
  <p>
    <%= f.label "用户性别" %><br />
    <%= f.select :user_sex,['男','女'],:include_blank =>false %>
  </p>
  <p>
    <%= f.label "用户类型" %><br />
    <%= f.select :user_kind_id, UserKind.find(:all).collect{|t|[t.user_kind_name,t.id]} ,:include_blank => false %>
  </p>
  <p>
    <%= f.label "用户级别" %><br />
    <%= f.text_field :user_level_id %>
  </p>
  <p>
    <%= f.submit '确认修改' %>
  </p>
<% end %>

<%= link_to '显示', @user %> |
<%= link_to '返回', users_path %>
